package com.etoak.api;

import com.etoak.common.core.vo.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

// 调用上传服务
@FeignClient(name = "upload-service")
public interface UploadService {

    /**
     * 声明接口 http://upload-service/upload/image
     * 要求 1、@PostMapping 必须设置 consumes 属性, 值必须是 multipart/form-data
     * 要求 2、参数 MultipartFile 前增加注解 @RequestPart
     */
    @PostMapping(value = "/upload/image",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public ResultVO<String> upload(@RequestPart MultipartFile pic);
}
